Blitz (154/640)

From:James L Boyd
Date:2 Sep 99 at 08:07:10
Subject:Re: Enforcer Hits

Tony Rolfe churned out *this* drivel:

> I've just started using Enforcer to test my Motelmanager and have
> encountered a W*I*E*R*D hit.
>
> If I click into a blank area of the Workbench screen, or double-click
> an Icon on the workbench screen I get a couple of Long Reads from
> zero. Even if I've just started my machine from Cold!!
>
> Anyway, that's not -my- problem.
>
> My problem is, why does the "Program$ =" line below give a hit?
> Someone suggested this code to get my current program name, but I get
> one read from zero. Looking at the Task Newtype, I can't see
> anything which looks like a pointer to a program name.

Now this is weird - this code is almost identical to what's in the
StatsFuncs.lha file, but the StatsFuncs one doesn't cause a hit. I
just ran this, and /YAM/ caused an Enforcer hit! I really can't see
why it should do this! Try the attached version, which, like I say,
is almost identical...

And the thing about clicking on WB causing hits is severely screwed ;)

----

Function.s ProgsName{}

If FromCLI

*stringbuffer = AllocMem_(255, 0)
suc.l=GetProgramName_(*stringbuffer,255)

If suc
pname$=Peek$(*stringbuffer)
EndIf

FreeMem_ *stringbuffer,255

Else pname$=Peek$(Peek.l(FindTask_(0)+$B0)+4)
EndIf

If pname$="" Then pname$="I only work when compiled!"

Function Return pname$

End Function

----

See ya,






James L Boyd - jamesboyd@all-hail.freeserve.co.uk

Member of Team *AMIGA*, and *Dogbert's New Ruling Class.*

Connected from Dundee, Scotland.

(http://surf.to/all-hail/)


Everybody got something to say/But I'll be moving along
And I'll see you all later.
-- Frank Black, /I Think I'm Starting To Lose It/, from "Pistolero"

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie